<template>
 <div class="album">
   <header @click="$router.push('/Special')">精选专题</header>
   <div class="album-box">
     <section>
      <li v-for="item in list" :key="item.id" @click="$router.push('/SpecialOne?id='+item.id)">
          <img :src="item.pic" alt="">
          <h3>{{item.title}}</h3>
          <p>{{item.descript}}</p>
      </li>
    </section>
   </div>
 </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      list: []
    };
  },
  mounted() {
    this.getList();
  },
  methods: {
    async getList() {
      let { data: res } = await this.$http.get(
        "https://api.it120.cc/small4/cms/news/list"
      );
      // console.log(res);
      this.list = res.data;
    }
  },
  computed: {},
  watch: {}
};
</script>

<style scoped>
.album {
  overflow: auto;
  position: relative;
}
header {
  width: 100%;
  height: 50px;
  position: absolute;
  top: 0;
  left: 0;
  line-height: 50px;
  overflow: auto;
  text-align: center;
  background-color: white;
}
.album-box {
  overflow: auto;
  width: 100%;
}
section {
  width: 100%;
  display: flex;
  overflow: auto;
  margin-top: 50px;
}
section > li {
  width: 80%;
  height: 300px;
  list-style: none;
  margin-left: 10px;
}
section > li > img {
  height: 200px;
}
section > li {
  margin-right: 10px;
}
h3 {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
p {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
</style>